package com.lvmama.controller.rhino.superfreetravel;

import com.github.pagehelper.PageInfo;
import com.lvmama.pojo.entity.rhino.superfreetravel.PageView;
import com.lvmama.pojo.entity.rhino.superfreetravel.PageViewVo;
import com.lvmama.pojo.entity.rhino.superfreetravel.SearchListVo;
import com.lvmama.pojo.entity.rhino.superfreetravel.SuperfreeFlowstatistic;
import com.lvmama.service.rhino.supperfreetravel.SuperfreetravelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @param
 * @Title:
 * @Author:wangpeng
 * @Description: TODO(这里用一句话描述这个方法的作用)
 * @return
 * @throws
 */
@RestController
@RequestMapping(value = "/superfreetravel")
@Slf4j
public class SuperfreetravelController {

	@Autowired
	private SuperfreetravelService service;

	/**
	 * 查询各元素点击量
	 * @return page
	 */
	@PostMapping(value = "list")
	public PageInfo<SuperfreeFlowstatistic> clickVolume(@RequestBody SearchListVo searchListVo) {
		log.info("SuperfreetravelController getList start ");
		PageInfo<SuperfreeFlowstatistic> list = null;
		try{
			list =service.searchList(searchListVo);
		}catch (Exception e){
			log.error("SuperfreetravelController getList error:",e.getMessage(),e);
		}
		log.info("SuperfreetravelController getList end ");
		return list;
	}

	/**
	 * 查询各页面PV UV
	 * @return page
	 */
	@PostMapping(value = "getPageViewList")
	public PageInfo<PageView> queryPVAndUV(@RequestBody PageViewVo pageViewVo) {
		log.info("SuperfreetravelController getPageVisitsList start ");
		PageInfo<PageView> list = null;
		try {

			list =service.getPageViewList(pageViewVo);
		}catch (Exception e){
			log.error("SuperfreetravelController getPageViewList error:",e.getMessage(),e);
		}
		log.info("SuperfreetravelController getPageViewList end ");
		return list;
	}
}
